<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>新增界面</title>
    <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet"/>
</head>
<body>
<div style="width:800px;height:100%;margin-left:270px;">
    <form id="insert" action="/patient/insert" method="post">
        用户id：<input class="form-control" type="text" th:value="${userid}" name="userid"><br>
        姓名：<input class="form-control" type="text" th:value="${name}" name="name"><br>
        证件类型：<input class="form-control" type="text" th:value="${certificatesType}" name="certificatesType"><br>
        证件编号：<input class="form-control" type="text" th:value="${certificatesNo}" name="certificatesNo"><br>
        <!--        性别：<input class="form-control" type="text" th:value="${sex}" name="sex"><br>-->
        性别：<input id="male" name="sex" type="radio" value="1" th:checked="${sex==1}"/>
            <label for="male">男</label>
            <input id="female" name="sex" type="radio" value="0" th:checked="${sex==0}"/>
            <label for="female">女</label><br><br>
        出生年月：<input class="form-control" type="date" th:value="${birthdate}" name="birthdate"><br>
        手机：<input class="form-control" type="text" th:value="${phone}" name="phone"><br>
<!--        是否结婚：<input class="form-control" type="text" th:value="${isMarry}" name="isMarry"><br>-->
        是否结婚：<input id="noMarry" name="isMarry" type="radio" value="0" th:checked="${isMarry==0}"/>
                <label for="noMarry">未婚</label>
                <input id="marry" name="isMarry" type="radio" value="1" th:checked="${isMarry==1}"/>
                <label for="marry">已婚</label><br><br>
        省code：<input class="form-control" type="text" th:value="${provinceCode}" name="provinceCode"><br>
        市code：<input class="form-control" type="text" th:value="${cityCode}" name="cityCode"><br>
        区code：<input class="form-control" type="text" th:value="${districtCode}" name="districtCode"><br>
        详情地址：<input class="form-control" type="text" th:value="${address}" name="address"><br>
        联系人姓名：<input class="form-control" type="text" th:value="${contactsName}" name="contactsName"><br>
        联系人证件类型：<input class="form-control" type="text" th:value="${contactsCertificatesType}"
                              name="contactCertificatesType"><br>
        联系人证件号：<input class="form-control" type="text" th:value="${contactsCertificatesNo}"
                            name="contactCertificatesNo"><br>
        联系人手机：<input class="form-control" type="text" th:value="${contactsPhone}" name="contactPhone"><br>
        就诊卡号：<input class="form-control" type="text" th:value="${cardNo}" name="medicalCardNo"><br>
<!--        是否有医保：<input class="form-control" type="text" th:value="${isInsure}" name="isInsure"><br>-->
        是否有医保：<input id="noInsure" name="isInsure" type="radio" value="0" th:checked="${isInsure==0}"/>
                    <label for="noInsure">否</label>
                    <input id="insure" name="isInsure" type="radio" value="1" th:checked="${isInsure==1}"/>
                    <label for="insure">是</label><br><br>
        状态（0：默认 1：已认证）：<input class="form-control" type="text" th:value="${status}" name="status"><br>
        <button class="btn btn-primary btn-lg btn-block">使用thymeleaf提交</button>
<!--        <button class="btn btn-primary btn-lg btn-block" onclick="insert()">使用JQuery Ajax提交</button>-->
    </form>
</div>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script>
    // function insert(){
    //     $.ajax({
    //         dataType: "json",
    //         url: "http://localhost:8080/patient/insertByAjax" ,
    //         data: $('#insert').serialize(),
    //         success: function (res) {
    //             console.log(res);//打印服务端返回的数据(调试用)
    //             if (res.status === 200 && res.readyState === 4) {
    //                 alert(res.message);
    //             }
    //         },
    //         error : function() {
    //             alert("异常！");
    //         }
    //     })
    // }
</script>
</body>
</html>